<?php
include_once 'autoload.php';
include_once 'funciones\basicas.php';
use phplivex\PHPLiveX;
use utiles\HelloWolrd;
use datos\VendedorDao;

$ajax = new PHPLiveX();    
$myClass = new HelloWolrd();  
$vendedorDao = new VendedorDao(conectarPDO());
$ajax->AjaxifyObjects(array("myClass", "vendedorDao"));  
// If validateEmail was a static function, you wouldn't need to create an object:  
// $ajax->AjaxifyClassMethods(array("Validation" => array("validateEmail")));  
/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
?>
<html>
    <head>    
    <script src="js/phplivex.js"></script>
    <?php $ajax->Run(FALSE); // Must be called inside the 'html' or 'body' tags    ?>
    <script>
        function test(){              
            vendedorDao.getVendedores({ 
                "content_type": "json",
                "onFinish": function(result){
                    alert(result);
                }
            });  
        }  
    </script>    
    </head>    
    <body>
        <input type="button" name="test" value="test" id="test" onclick="test();">
        <div id="resp"></div>
    </body>
</html>
